﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UserManager.aspx.cs" Inherits="QuangMobile.Admin.UserManager"
    MasterPageFile="~/Admin/AdminSite.Master" %>

<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
    <div class="NoiDungChinh">
        <img class="FormImage" src="images/computer.png" />
        <p class="FormTitle">
            Quản trị người dùng</p>
    </div>
    <div class="FormMain">
        <div class="Form Search">
            Nhập tiêu chí tìm kiếm:
            <asp:TextBox ID="txtSearch" runat="server" CssClass="SearchBox InputText"></asp:TextBox>
            <asp:Button ID="btnSearch" runat="server" Text="Tìm kiếm" CssClass="cmdBtn" OnClick="btnSearch_Click"
                CausesValidation="False" />
        </div>
        <div class="Form Update" runat="server" id="formUpdate">
            <table border="1px" class="ListForm">
                <tr>
                    <th align="left">
                        Họ và tên <font color="red">(*)</font>
                    </th>
                    <td>
                        <asp:TextBox ID="txtHoTen" runat="server" CssClass="InputText"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtHoTen"
                            CssClass="formValidate" Display="Dynamic" ErrorMessage="Mời nhập tên người dùng"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <th align="left">
                        Tên đăng nhập <font color="red">(*)</font>
                    </th>
                    <td>
                        <asp:TextBox ID="txtUserName" runat="server" CssClass="InputText"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtUserName"
                            CssClass="formValidate" Display="Dynamic" ErrorMessage="Mời nhập tên đăng nhập hệ thống"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr runat="server" id="PasswordField">
                    <th align="left">
                        Mật khẩu <font color="red">(*)</font>
                    </th>
                    <td>
                        <asp:TextBox ID="txtPassword" TextMode="Password" runat="server" CssClass="InputText"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtPassword"
                            CssClass="formValidate" Display="Dynamic" ErrorMessage="Mời nhập mật khẩu"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr runat="server" id="RePasswordField" visible="false">
                    <th align="left">
                        Nhập lại mật khẩu <font color="red">(*)</font>
                    </th>
                    <td>
                        <asp:TextBox ID="txtRePassword" TextMode="Password" runat="server" CssClass="InputText"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtRePassword"
                            CssClass="formValidate" Display="Dynamic" ErrorMessage="Nhập lại mật khẩu"></asp:RequiredFieldValidator>
                        <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToCompare="txtPassword"
                            ControlToValidate="txtRePassword" CssClass="formValidate" Display="Dynamic" ErrorMessage="Nhập lại mật khẩu không đúng"></asp:CompareValidator>
                    </td>
                </tr>
                <tr>
                    <th align="left">
                        Email
                    </th>
                    <td>
                        <asp:TextBox ID="txtEmail" runat="server" CssClass="InputText"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="center">
                        <asp:Button ID="btnLuu" runat="server" Text="Lưu lại" CssClass="cmdBtn" OnClick="btnLuu_Click" />
                        <asp:Button ID="btnHuy" runat="server" Text="Hủy" CssClass="cmdBtn" OnClick="btnHuy_Click"
                            CausesValidation="False" />
                    </td>
                </tr>
            </table>
        </div>
        <div class="Form View">
            <asp:Button ID="btnThem" runat="server" Text="Thêm mới" CssClass="cmdBtn" OnClick="btnThem_Click"
                CausesValidation="False" />
            <asp:GridView ID="grdDanhMuc" runat="server" AutoGenerateColumns="False" CssClass="ListTable"
                DataKeyNames="ID" OnRowCommand="grdDanhMuc_RowCommand">
                <Columns>
                    <asp:TemplateField HeaderText="STT">
                        <ItemTemplate>
                            <asp:Label ID="lblIDDM" runat="server" Text='<%# Container.DataItemIndex + 1 %>'></asp:Label>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="UserName">
                        <ItemTemplate>
                            <asp:Label ID="lblUserName" runat="server" Text='<%# Eval("Username") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Họ tên">
                        <ItemTemplate>
                            <asp:Label ID="lblHoTen" runat="server" Text='<%# Eval("HoTen") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Email">
                        <ItemTemplate>
                            <asp:Label ID="lblEmail" runat="server" Text='<%# Eval("Email") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Sửa">
                        <ItemTemplate>
                            <asp:ImageButton ID="lbtEdit" runat="server" ImageUrl="../images/edit.gif" CommandName="<%# QuangMobile.MyConst.Action.Update %>"
                                CommandArgument='<%# Eval("ID") %>'></asp:ImageButton>
                        </ItemTemplate>
                        <ItemStyle Width="10px" HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Xóa">
                        <ItemTemplate>
                            <asp:ImageButton ID="lbtDelete" runat="server" ImageUrl="../images/delete.png" CommandName="<%# QuangMobile.MyConst.Action.Delete %>"
                                OnClientClick="return confirm('Bạn có chắc là muốn xóa bản ghi này không ?')"
                                CommandArgument='<%# Eval("ID") %>'></asp:ImageButton>
                        </ItemTemplate>
                        <ItemStyle Width="10px" HorizontalAlign="Center" />
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </div>
    </div>
</asp:Content>
